package com.xingchi.tornado.storage.core.exception;

import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.xingchi.tornado.core.exception.UncheckedException;

/**
 * 文件不存在异常
 *
 * @author xingchi
 * @date 2024/4/21 20:38
 */
public class FileNotFoundException extends UncheckedException {

    public FileNotFoundException() {
        this(FileCode.FILE_NOT_FOUND.getCode(), FileCode.FILE_NOT_FOUND.getMessage());
    }

    public FileNotFoundException(String message) {
        this(FileCode.FILE_NOT_FOUND.getCode(), StringUtils.isBlank(message) ? FileCode.FILE_NOT_FOUND.getMessage() : message);
    }

    public FileNotFoundException(int code, String message) {
        super(code, message);
    }

    public FileNotFoundException(int code, String format, Object... args) {
        super(code, format, args);
    }
}
